/* 默认参与人 */
import React, { PureComponent } from 'react';
import { inject, observer } from 'mobx-react';
import { WeaTableNew } from 'comsMobx';

const { WeaTable } = WeaTableNew;

@inject('coworkStoreMap')
@observer
export default class DefalutJoiner extends PureComponent {
  constructor(props) {
    super(props);
    this.state = {};
    this.store = props.coworkStoreMap.getMapStore(props.storeMapKey);
  }

  componentDidMount() {
    const { isReadOnly, defaultTypeId } = this.props;
    const { getDefaultJoinList, newCoworkStatus } = this.store;
    if (newCoworkStatus) {
      const typeid = isReadOnly ? defaultTypeId : newCoworkStatus.selectValue;
      const params = { typeid, sharetype: 'typedefshare', table_nocheck: '1' };
      getDefaultJoinList(params);
    }
  }

  render() {
    const { defalutJoinerTable } = this.store;
    return (
      <div>
        <WeaTable
          ecId={`${
            (this && this.props && this.props.ecId) || ''
          }_WeaTable@pv7320`}
          comsWeaTableStore={defalutJoinerTable}
        />
      </div>
    );
  }
}
